﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:AppCommerciaux.Views" x:Class="AppCommerciaux.Views.UserControlSynchro" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    
    <UserControl.Resources>
        <Style TargetType="ListViewItem">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Status}" Value="success">
                    <Setter Property="Foreground" Value="Blue" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Status}" Value="error">
                    <Setter Property="Foreground" Value="Red" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Status}" Value="nothing">
                    <Setter Property="Foreground" Value="Gray" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="gridPrincipale">
        <ListView x:Name="lstviewSynchro" MinHeight="500" Margin="0 50 0 0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" MinWidth="600">
            <ListView.View>
                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Log de la Synchro">
                    <GridViewColumn Header="Heure" Width="200" DisplayMemberBinding="{Binding Hour}"/>
                    <GridViewColumn Header="Entitée" Width="300" DisplayMemberBinding="{Binding Entity}"/>
                    <GridViewColumn Header="Observations" Width="500" DisplayMemberBinding="{Binding Observation}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Content="Synchronisation des données" HorizontalAlignment="Left" Margin="16,14,0,0" 
                VerticalAlignment="Top" Width="160" Click="Button_Click" IsEnabled="{Binding EnableButtonReception}"/>
        <Button Content="Envoi des données" HorizontalAlignment="Left" Margin="408,10,0,0" VerticalAlignment="Top" Width="182" Click="Button_Click_1" Visibility="Hidden"/>

    </Grid>
</UserControl>
